import request from '@/utils/request'

export function list(data) {
  return request({
    url: 'product/brand/index',
    method: 'post',
    data: data
  })
}
export function createBrand(data) {
  return request({
    url: 'product/brand/create',
    method: 'post',
    data: data
  })
}
export function updateBrand(data) {
  return request({
    url: 'product/brand/update',
    method: 'post',
    data: data
  })
}
export function delBrand(data) {
  return request({
    url: 'product/brand/delete',
    method: 'post',
    data: data
  })
}
export function supplierList(data) {
  return request({
    url: 'product/supplier/index',
    method: 'post',
    data: data
  })
}
export function createSupplier(data) {
  return request({
    url: 'product/supplier/create',
    method: 'post',
    data: data
  })
}
export function updateSupplier(data) {
  return request({
    url: 'product/supplier/update',
    method: 'post',
    data: data
  })
}
export function delSupplier(data) {
  return request({
    url: 'product/supplier/delete',
    method: 'post',
    data: data
  })
}
export function manufacturerList(data) {
  return request({
    url: 'product/manufacturer/index',
    method: 'post',
    data: data
  })
}
export function createManufacturer(data) {
  return request({
    url: 'product/manufacturer/create',
    method: 'post',
    data: data
  })
}
export function updateManufacturer(data) {
  return request({
    url: 'product/manufacturer/update',
    method: 'post',
    data: data
  })
}
export function delManufacturer(data) {
  return request({
    url: 'product/manufacturer/delete',
    method: 'post',
    data: data
  })
}

export function unitList(data) {
  return request({
    url: 'product/unit/index',
    method: 'post',
    data: data
  })
}
export function createUnit(data) {
  return request({
    url: 'product/unit/create',
    method: 'post',
    data: data
  })
}
export function updateUnit(data) {
  return request({
    url: 'product/unit/update',
    method: 'post',
    data: data
  })
}
export function delUnit(data) {
  return request({
    url: 'product/unit/delete',
    method: 'post',
    data: data
  })
}

export function packList(data) {
  return request({
    url: 'product/pack/index',
    method: 'post',
    data: data
  })
}
export function createPack(data) {
  return request({
    url: 'product/pack/create',
    method: 'post',
    data: data
  })
}
export function updatePack(data) {
  return request({
    url: 'product/pack/update',
    method: 'post',
    data: data
  })
}
export function delPack(data) {
  return request({
    url: 'product/pack/delete',
    method: 'post',
    data: data
  })
}
export function productList(data) {
  return request({
    url: 'product/product/index',
    method: 'post',
    data: data
  })
}
export function createProduct(data) {
  return request({
    url: 'product/product/create',
    method: 'post',
    data: data
  })
}
export function updateProduct(data) {
  return request({
    url: 'product/product/update',
    method: 'post',
    data: data
  })
}
export function delProduct(data) {
  return request({
    url: 'product/product/delete',
    method: 'post',
    data: data
  })
}
export function getBrand(data) {
  return request({
    url: 'product/brand/getBrand',
    method: 'post',
    data: data
  })
}
export function getManufacturer(data) {
  return request({
    url: 'product/manufacturer/getManufacturer',
    method: 'post',
    data: data
  })
}
export function getSupplier(data) {
  return request({
    url: 'product/supplier/getSupplier',
    method: 'post',
    data: data
  })
}
export function getUnit(data) {
  return request({
    url: 'product/unit/getUnit',
    method: 'post',
    data: data
  })
}
export function getPack(data) {
  return request({
    url: 'product/pack/getPack',
    method: 'post',
    data: data
  })
}
export function getProduct(data) {
  return request({
    url: 'product/product/getProduct',
    method: 'post',
    data: data
  })
}

// 商品对应的包装
export function getGPSelect(data) {
  return request({
    url: 'product/product/goodsPacking',
    method: 'post',
    data: data
  })
}

// 商品对应的包装
export function getGoods(data) {
  return request({
    url: 'product/product/getGoods',
    method: 'post',
    data: data
  })
}

// 商品对应的包装
export function getPacking(data) {
  return request({
    url: 'product/product/getPacking',
    method: 'post',
    data: data
  })
}

export function getInventory(data) {
  return request({
    url: 'product/product/inventory',
    method: 'post',
    data: data
  })
}

export function getRemote() {
  return request({
    url: '/houniao/goods/category/remote',
    method: 'get'
  })
}

export function getCategory() {
  return request({
    url: '/houniao/goods/category',
    method: 'get'
  })
}

export function getShopGoods(data) {
  return request({
    url: 'houniao/goods',
    method: 'get',
    params: data
  })
}

export function getGoodsRemote(data) {
  return request({
    url: '/houniao/goods/remote',
    method: 'get',
    params: data
  })
}

export function getSync() {
  return request({
    url: '/houniao/goods/category/sync',
    method: 'post'
  })
}

export function getGoodSync(data) {
  return request({
    url: '/houniao/goods/sync',
    method: 'post',
    data
  })
}

export function delCategory(data) {
  return request({
    url: '/houniao/goods/category/' + data,
    method: 'delete'
  })
}
